import context from './context'
import { ipcMain } from 'electron'
export const register = (mainWindow) => {
  context.forEach((event) => {
    const type = event.type || 'on'
    ipcMain.removeHandler(event.channel)
    ipcMain[type](event.channel, event.cb.bind(event, mainWindow))
  })
}
